package svgedit.TestSVG;

import static org.junit.Assert.assertTrue;
import java.awt.Color;
import org.junit.Test;
import svgedit.svg.SVGPaint;

/**
 * test SVGPaint class
 */

public class SVGPaintTest
{
    public static final int SVG_PAINTTYPE_RGBCOLOR = 1;
    public static final int SVG_PAINTTYPE_NONE = 101;
    
    @Test
    public void testgetPaintType()
    {
        SVGPaint paint = new SVGPaint();
        paint.setPaint(101, "uri", "blue", "iccColor");
        assertTrue(101 == paint.getPaintType());
    }
    
    /**
     * test getRGBColor() method
     */
    @Test
    public void testgetRGBColor()
    {
        Color Color = new Color(0, 0, 255);
        SVGPaint paint = new SVGPaint();
        paint.setPaint(SVG_PAINTTYPE_RGBCOLOR, "uri", "blue", "iccColor");
        paint.setRGBColor(Color);
        assertTrue(Color == paint.getRGBColor());
    }
    
    /**
     * test setPain() method
     */
    @Test
    public void testsetPaint()
    {
        Color Color = new Color(0, 0, 255);
        SVGPaint paint = new SVGPaint();
        paint.setPaint(101, "uri", "blue", "iccColor");
        assertTrue(101 == paint.getPaintType());
        assertTrue(paint.getRGBColor() == null);
        paint.setPaint(1, "uri", "blue", "iccColor");
        assertTrue(1 == paint.getPaintType());
        paint.setRGBColor(Color);
        assertTrue(paint.getRGBColor() == Color);
        
    }
    
}
